#pragma once
#include <opencv\cv.h>
#include <opencv\highgui.h>

class TrackerModel;
class ChannelView;
class ChannelFourBoxView;

class ChannelModel
{
public:
	ChannelModel(TrackerModel* trackerModel);
	~ChannelModel(void);

	void initialize();

	void updateImage( IplImage* image );
	void updateImageData( char* data );

	inline IplImage* getImage() { return _channelImage; }

	inline void setView( ChannelView* view ) { _view = view; }
	inline ChannelView* getView() { return _view; }

	inline void setChannelIndex( int index ) { _channelIndex = index; }
	inline int getChannelIndex() { return _channelIndex; }

	inline void setChannelFourBox( ChannelFourBoxView* boxView ) { _boxView = boxView; }
	inline ChannelFourBoxView* getChannelFourBox() { return _boxView; }
	
	void setFrontPoints(float points[]) 
	{ 	
		for(int i=0;i<8;i++)		 
		 _frontPoints[i]=points[i]; 
	}
	 float * getFrontPoints() { return _frontPoints; }
	
	 void setBackPoints(float points[]) 
	{
		for(int i=0;i<8;i++)
		_backPoints[i] = points[i]; 
	}

	 float * getBackPoints() { return _backPoints; }	

private:

	IplImage* _channelImage;

	ChannelView* _view;

	ChannelFourBoxView* _boxView;

	TrackerModel* _trackerModel;

	int _channelIndex;

	float *_frontPoints;
	float *_backPoints;
	
};

